home *** CD-ROM | disk | FTP | other *** search
/ Freelog 22 / freelog 22.iso / Prog / Djgpp / DJDEV203.ZIP / include / dir.h < prev    next >
Encoding:
C/C++ Source or Header  |  1998-06-28  |  2.8 KB  |  93 lines

  1. /* Copyright (C) 1998 DJ Delorie, see COPYING.DJ for details */
  2. /* Copyright (C) 1995 DJ Delorie, see COPYING.DJ for details */
  3. #ifndef __dj_include_dir_h_
  4. #define __dj_include_dir_h_
  5.  
  6. #ifdef __cplusplus
  7. extern "C" {
  8. #endif
  9.  
  10. #ifndef __dj_ENFORCE_ANSI_FREESTANDING
  11.  
  12. #ifndef __STRICT_ANSI__
  13.  
  14. #ifndef _POSIX_SOURCE
  15.  
  16. /* ffblk is also enhanced for LFNs; the dos 21 byte reserved area is used to
  17.    hold the extra information.  Fields marked LFN are only valid if the magic
  18.    is set to LFN32 */
  19.  
  20. /* This is for g++ 2.7.2 and below */
  21. #pragma pack(1)
  22.   
  23. struct ffblk {
  24.   char lfn_magic[6] __attribute__((packed));            /* LFN */
  25.   short lfn_handle __attribute__((packed));            /* LFN */
  26.   unsigned short lfn_ctime __attribute__((packed));        /* LFN */
  27.   unsigned short lfn_cdate __attribute__((packed));        /* LFN */
  28.   unsigned short lfn_atime __attribute__((packed));        /* LFN */
  29.   unsigned short lfn_adate __attribute__((packed));        /* LFN */
  30.   char _ff_reserved[5] __attribute__((packed));
  31.   unsigned char  ff_attrib __attribute__((packed));
  32.   unsigned short ff_ftime __attribute__((packed));
  33.   unsigned short ff_fdate __attribute__((packed));
  34.   unsigned long  ff_fsize __attribute__((packed));
  35.   char ff_name[260] __attribute__((packed));
  36. };
  37.  
  38. struct ffblklfn {
  39.   unsigned long      fd_attrib __attribute__((packed));
  40.   unsigned long long fd_ctime __attribute__((packed));
  41.   unsigned long long fd_atime __attribute__((packed));
  42.   unsigned long long fd_mtime __attribute__((packed));
  43.   unsigned long      fd_sizehi __attribute__((packed));
  44.   unsigned long      fd_size __attribute__((packed));
  45.   unsigned long long fd_reserved __attribute__((packed));
  46.   char               fd_longname[260] __attribute__((packed));
  47.   char               fd_name[14] __attribute__((packed));
  48. };
  49.  
  50. #pragma pack(4)
  51.  
  52. #define FA_RDONLY       1
  53. #define FA_HIDDEN       2
  54. #define FA_SYSTEM       4
  55. #define FA_LABEL        8
  56. #define FA_DIREC        16
  57. #define FA_ARCH         32
  58.  
  59. /* for fnmerge/fnsplit */
  60. #define MAXPATH   260
  61. #define MAXDRIVE  3
  62. #define MAXDIR      256
  63. #define MAXFILE   256
  64. #define MAXEXT      255
  65.  
  66. #define WILDCARDS 0x01
  67. #define EXTENSION 0x02
  68. #define FILENAME  0x04
  69. #define DIRECTORY 0x08
  70. #define DRIVE      0x10
  71.  
  72. int    __file_tree_walk(const char *_dir, int (*_fn)(const char *_path, const struct ffblk *_ff));
  73. int    findfirst(const char *_pathname, struct ffblk *_ffblk, int _attrib);
  74. int    findnext(struct ffblk *_ffblk);
  75. void    fnmerge (char *_path, const char *_drive, const char *_dir, const char *_name, const char *_ext);
  76. int    fnsplit (const char *_path, char *_drive, char *_dir, char *_name, char *_ext);
  77. int    getdisk(void);
  78. char *    searchpath(const char *_program);
  79. int    setdisk(int _drive);
  80.  
  81. #endif /* !_POSIX_SOURCE */
  82. #endif /* !__STRICT_ANSI__ */
  83. #endif /* !__dj_ENFORCE_ANSI_FREESTANDING */
  84.  
  85. #ifndef __dj_ENFORCE_FUNCTION_CALLS
  86. #endif /* !__dj_ENFORCE_FUNCTION_CALLS */
  87.  
  88. #ifdef __cplusplus
  89. }
  90. #endif
  91.  
  92. #endif /* !__dj_include_dir.h_ */
  93.